<html>
	<head>
		<title>Newton Game Dynamics DBPro Wrapper v1.31</title></head>
	<body alink="#fa634e" bgcolor="#efeff9" link="#3646fc" text="#000000" vlink="#ff6633">
		<h1>Newton SDK DBPro Wrapper v1.32</h1>
		<P>By Walaber<BR>
		   All Coding between 1.31-1.32B by Kjelle<BR>
		   Updated to 1.53 by Tiresius</P>
        <p><a href="ndb_docs_main.htm">Main Index of Commands</a></p>
		<br>
		<h2>World Interface Commands</h2>
		<a name="NDB_NewtonCreate"></a>
		<table bordercolorlight="#0506a5" bordercolordark="#0506a5" bgcolor="#ffffff" border="1"
			cellspacing="0" width="85%">
			<tbody>
				<tr>
					<td bgcolor="#232323"><h3><font color="#fafafa">NDB_NewtonCreate</font></h3>
					</td>
				</tr>
				<tr>
					<td bgcolor="#747ff6"><font color="#ffffff" face="monospace">syntax: NDB_NewtonCreate</font></td>
				</tr>
				<tr>
					<td bgcolor="#fafafa"><font face="monospace">
							<table border="0" width="95%">
								<tbody>
									<tr>
										<td width="5%"></td>
										<td width="50%">no values passed to this function</td>
										<td></td>
									</tr>
								</tbody></table>
						</font>
					</td>
				</tr>
				<tr>
					<td bgcolor="#dadada"><font face="monospace">returns: nothing</font></td>
				</tr>
				<tr>
					<td bgcolor="#fafafa"><b>Comments:</b> This command initialized the entire Newton
						system, and prepares for adding Rigid Bodies. <b>You must call this function before
							any other Newton functions.</b></td>
				</tr>
			</tbody></table>
		<p>
			<a name="NDB_NewtonDestroy"></a>
	 	  <table bordercolorlight="#0506a5" bordercolordark="#0506a5" bgcolor="#ffffff" border="1"
 				cellspacing="0" width="85%">
				<tbody>
					<tr>
						<td bgcolor="#232323"><h3><font color="#fafafa">NDB_NewtonDestroy</font></h3>
						</td>
					</tr>
					<tr>
						<td bgcolor="#747ff6"><font color="#ffffff" face="monospace">syntax: NDB_NewtonDestroy</font></td>
					</tr>
					<tr>
						<td bgcolor="#fafafa"><font face="monospace">
								<table border="0" width="95%">
									<tbody>
										<tr>
											<td width="5%"></td>
											<td width="50%">no values passed to this function</td>
											<td></td>
										</tr>
									</tbody></table>
							</font>
						</td>
					</tr>
					<tr>
						<td bgcolor="#dadada"><font face="monospace">returns: nothing</font></td>
					</tr>
					<tr>
						<td bgcolor="#fafafa"><b>Comments:</b> Destroys the entire Newton world. If any
							rigid bodies or joints exist, they will be destroyed. If rigid bodies have the <a href="ndb_docs_body.htm#NDB_NewtonBodySetDestructorCallback">
								NDB_NewtonBodySetDestructorCallback</a> command called, the DBPro object
							representing the body will also be automatically deleted.</td>
					</tr>
				</tbody></table>
		<p>
			<a name="NDB_NewtonSetSolverModel"></a>
			<table bordercolorlight="#0506a5" bordercolordark="#0506a5" bgcolor="#ffffff" border="1"
				cellspacing="0" width="85%" ID="Table1">
				<tbody>
					<tr>
						<td bgcolor="#232323"><h3><font color="#fafafa">NDB_NewtonSetSolverModel</font></h3>
						</td>
					</tr>
					<tr>
						<td bgcolor="#747ff6"><font color="#ffffff" face="monospace">syntax:
								NDB_NewtonSetSolverModel (int)</font></td>
					</tr>
					<tr>
						<td bgcolor="#fafafa"><font face="monospace">
								<table border="0" width="95%" ID="Table2">
									<tbody>
										<tr>
											<td width="5%"></td>
											<td width="50%">
												int
											</td>
											<td>SolverModel</td>
										</tr>
									</tbody></table>
							</font>
						</td>
					</tr>
					<tr>
						<td bgcolor="#dadada"><font face="monospace">returns: nothing</font></td>
					</tr>
					<tr>
						<td bgcolor="#fafafa"><b>Comments:</b> This function allows the application to
							configure the Newton solver to work in three different modes.
							<P>
								<H4>0</H4>
							Is the exact mode. This is good for application where precision is more
							important than speed, ex: realistic simulation.
							<P>
								<H4>1</H4>
							Is the adaptive mode, the solver is not as exact but the simulation will still
							maintain a high degree of accuracy. This mode is good for applications were a
							good degree of stability is important but not as important as speed.
							<P>
								<H4>n</H4>
								Linear mode. The solver will not try to reduce the joints relative acceleration
								errors to below some limit, instead it will perform up to n passes over the
								joint configuration each time reducing the acceleration error, but it will
								terminate when the number of passes is exhausted regardless of the error
								magnitude. In general this is the fastest mode and is is good for applications
								where speed is the only important factor, ex: video games.
								<H4>Remarks</H4>
								the adaptive friction model combined with the linear model make for the fastest
								possible configuration of the Newton solver. This setup is best for games. If
								you need the best realistic behavior, we recommend the use of the exact solver
								and exact friction model which are the defaults.
								<br>
								<br>
							v1.31</td>
					</tr>
				</tbody></table>
		<p>
			<a name="NDB_NewtonSetFrictionModel"></a>
			<table bordercolorlight="#0506a5" bordercolordark="#0506a5" bgcolor="#ffffff" border="1"
				cellspacing="0" width="85%" ID="Table3">
				<tbody>
					<tr>
						<td bgcolor="#232323"><h3><font color="#fafafa">NDB_NewtonSetFrictionModel</font></h3>
						</td>
					</tr>
					<tr>
						<td bgcolor="#747ff6"><font color="#ffffff" face="monospace">syntax:
								NDB_NewtonSetFrictionModel (int)</font></td>
					</tr>
					<tr>
						<td bgcolor="#fafafa"><font face="monospace">
								<table border="0" width="95%" ID="Table4">
									<tbody>
										<tr>
											<td width="5%"></td>
											<td width="50%">
												int
											</td>
											<td>FrictionModel</td>
										</tr>
									</tbody></table>
							</font>
						</td>
					</tr>
					<tr>
						<td bgcolor="#dadada"><font face="monospace">returns: nothing</font></td>
					</tr>
					<tr>
						<td bgcolor="#fafafa"><b>Comments:</b> This function allows the application to
							chose between and exact or an adaptive coulumb friction model
							<P>
								<H4>0</H4>
							Is the exact model. Friction forces are calculated in each frame. This model is
							good for applications where precision is more important than speed, ex:
							realistic simulation.
							<P>
								<H4>1</H4>
							Is the adaptive model. Here values from previous frames are used to determine
							the maximum friction values of the current frame. This is about 10% faster than
							the exact model however it may introduce strange friction behaviors. For
							example a bouncing object tumbling down a ramp will act as a friction less
							object because the contacts do not have continuity. In general each time a new
							contact is generated the friction value is zero, only if the contact persist a
							non zero friction values is used. The second effect is that if a normal force
							is very strong, and if the contact is suddenly destroyed, a very strong
							friction force will be generated at the contact point making the object react
							in a non-familiar way.
							<P>
								<H4>Remarks</H4>
								the adaptive friction model combined with the linear model make for the fastest
								possible configuration of the Newton solver. This setup is best for games. If
								you need the best realistic behavior, we recommend the use of the exact solver
								and exact friction model which are the defaults.
								<br>
								<br>
							v1.31</td>
					</tr>
				</tbody></table>
		<p>
			<a name="NDB_NewtonSetPlatformArchitecture"></a>
			<table bordercolorlight="#0506a5" bordercolordark="#0506a5" bgcolor="#ffffff" border="1"
				cellspacing="0" width="85%" ID="Table3">
				<tbody>
					<tr>
						<td bgcolor="#232323"><h3><font color="#fafafa">NDB_NewtonSetPlatformArchitecture</font></h3>
						</td>
					</tr>
					<tr>
						<td bgcolor="#747ff6"><font color="#ffffff" face="monospace">syntax:
								NDB_NewtonSetPlatformArchitecture (int)</font></td>
					</tr>
					<tr>
						<td bgcolor="#fafafa"><font face="monospace">
								<table border="0" width="95%" ID="Table4">
									<tbody>
										<tr>
											<td width="5%"></td>
											<td width="50%">
												int
											</td>
											<td>Floating point flag</td>
										</tr>
									</tbody></table>
							</font>
						</td>
					</tr>
					<tr>
						<td bgcolor="#dadada"><font face="monospace">returns: nothing</font></td>
					</tr>
					<tr>
						<td bgcolor="#fafafa"><b>Comments:</b> This function allows the
						          application to configure the Newton to take advantage for specific
								  hardware architecture in the same platform.
							<P>
								<H4>0</H4>
							Force the hardware lower common denominator for the running platform.
							<P>
								<H4>1</H4>
							The engine will try to use common floating point enhancement like spacial instruction
							set on the specific architecture. This mode made lead to result that differ
							from mode 1 and 2 as the accumulation round off errors maybe different.
							<P>
								<H4>2</H4>
							The engine will try to use the best possible hardware setting found in the current
							platform this is the default configuration. This mode made lead to result that differ
							from mode 1 and 2 as the accumulation round off errors maybe different.
							<P>
								<H4>Remarks</H4>
								The only hardware mode guarantee to work is mode 0. all other are only hints to the
								engine, for example setting mode 1 will take not effect on CPUs without specially
								floating point instructions set.
								<br>
								<br>
							v1.53</td>
					</tr>
				</tbody></table>
		<p>
			<a name="NDB_NewtonUpdate"></a>
			<table bordercolorlight="#0506a5" bordercolordark="#0506a5" bgcolor="#ffffff" border="1"
				cellspacing="0" width="85%">
				<tbody>
					<tr>
						<td bgcolor="#232323"><h3><font color="#fafafa">NDB_NewtonUpdate</font></h3>
						</td>
					</tr>
					<tr>
						<td bgcolor="#747ff6"><font color="#ffffff" face="monospace">syntax: NDB_NewtonUpdate
								[timestep]</font></td>
					</tr>
					<tr>
						<td bgcolor="#fafafa"><font face="monospace">
								<table border="0" width="95%">
									<tbody>
										<tr>
											<td width="5%"></td>
											<td width="15%">timestep</td>
											<td>amount of time in seconds (float)</td>
										</tr>
									</tbody></table>
							</font>
						</td>
					</tr>
					<tr>
						<td bgcolor="#dadada"><font face="monospace">returns: nothing</font></td>
					</tr>
					<tr>
						<td bgcolor="#fafafa"><b>Comments:</b> This function advances the Newton world by
							the amount of seconds provided. If no time value is provided, the wrapper uses
							an internal timer to automatically update for you. By specifying your own
							timestep, you can create special effects like slow-motion, etc.</td>
					</tr>
					<tr>
						<td bgcolor="#fafafa">
							<font face="monospace"><b>NDB_NewtonUpdate</b></font> update by amount of time
							since last call to the function.<br>
							<font face="monospace"><b>NDB_NewtonUpdate 0.05</b></font> update by value of
							0.05 seconds.
						</td>
					</tr>
				</tbody></table>
		<p>
			<a name="NDB_NewtonSetMinimumFrameRate"></a>
			<table bordercolorlight="#0506a5" bordercolordark="#0506a5" bgcolor="#ffffff" border="1"
				cellspacing="0" width="85%">
				<tbody>
					<tr>
						<td bgcolor="#232323"><h3><font color="#fafafa">NDB_NewtonSetMinimumFrameRate</font></h3>
						</td>
					</tr>
					<tr>
						<td bgcolor="#747ff6"><font color="#ffffff" face="monospace">syntax:
								NDB_NewtonSetMinimumFrameRate framerate</font></td>
					</tr>
					<tr>
						<td bgcolor="#fafafa"><font face="monospace">
								<table border="0" width="95%">
									<tbody>
										<tr>
											<td width="5%"></td>
											<td width="15%">framerate</td>
											<td>minimum frame rate (float 20-1000)</td>
										</tr>
									</tbody></table>
							</font>
						</td>
					</tr>
					<tr>
						<td bgcolor="#dadada"><font face="monospace">returns: nothing</font></td>
					</tr>
					<tr>
						<td bgcolor="#fafafa"><b>Comments:</b> Limited to values between 20 and 1000.
							Default is 60. If the framerate drops below this number, Newton will perform
							substeps to maintain physics accuracy.</td>
					</tr>
					<tr>
						<td bgcolor="#fafafa">
							<font face="monospace"><b>NDB_NewtonSetMinimumFrameRate 30</b></font> set
							minimum framerate to 30fps.
						</td>
					</tr>
				</tbody></table>
		<p>
			<a name="NDB_NewtonGetTimeStep"></a>
			<table bordercolorlight="#0506a5" bordercolordark="#0506a5" bgcolor="#ffffff" border="1"
				cellspacing="0" width="85%" ID="Table5">
				<tbody>
					<tr>
						<td bgcolor="#232323"><h3><font color="#fafafa">NDB_NewtonGetTimeStep</font></h3>
						</td>
					</tr>
					<tr>
						<td bgcolor="#747ff6"><font color="#ffffff" face="monospace">syntax: float =
								NDB_NewtonGetTimeStep()</font></td>
					</tr>
					<tr>
						<td bgcolor="#fafafa"><font face="monospace">
								<table border="0" width="95%" ID="Table6">
									<tbody>
										<tr>
											<td width="5%"></td>
											<td width="15%"></td>
											<td></td>
										</tr>
									</tbody></table>
							</font>
						</td>
					</tr>
					<tr>
						<td bgcolor="#dadada"><font face="monospace">returns: Return the correct time step for
								this simulation update. </font>
						</td>
					</tr>
					<tr>
						<td bgcolor="#fafafa">
							<P><b>Comments:</b> This application can be used to get the correct siulation time
								step.</P>
							<P>v1.31</P>
						</td>
					</tr>
				</tbody></table>
		<p>
			<a name="NDB_NewtonDestroyAllBodies"></a>
			<table cellspacing="0" bordercolorlight="#0506a5" bordercolordark="#0506a5" bgcolor="#ffffff"
				border="1" width="85%">
				<tbody>
					<tr>
						<td bgcolor="#232323"><h3><font color="#fafafa">NDB_NewtonDestroyAllBodies</font></h3>
						</td>
					</tr>
					<tr>
						<td bgcolor="#747ff6"><font color="#ffffff" face="monospace">syntax:
								NDB_NewtonDestroyAllBodies</font></td>
					</tr>
					<tr>
						<td bgcolor="#fafafa"><font face="monospace">
								<table border="0" width="95%">
									<tbody>
										<tr>
											<td width="5%"></td>
											<td width="50%">no values passed to this function</td>
											<td></td>
										</tr>
									</tbody></table>
							</font>
						</td>
					</tr>
					<tr>
						<td bgcolor="#dadada"><font face="monospace">returns: nothing</font></td>
					</tr>
					<tr>
						<td bgcolor="#fafafa"><b>Comments:</b> Removes all rigid bodies from the Newton
							world. If rigid bodies have the <a href="ndb_docs_body.htm#NDB_NewtonBodySetDestructorCallback">NDB_NewtonBodySetDestructorCallback</a>
							command called, the DBPro object representing the body will also be
							automatically deleted.</td>
					</tr>
				</tbody></table>
		<p>
			<a name="NDB_NewtonSetWorldSize"></a>
			<table cellspacing="0" bordercolorlight="#0506a5" bordercolordark="#0506a5" bgcolor="#ffffff"
				border="1" width="85%">
				<tbody>
					<tr>
						<td bgcolor="#232323"><h3><font color="#fafafa">NDB_NewtonSetWorldSize</font></h3>
						</td>
					</tr>
					<tr>
						<td bgcolor="#747ff6"><font color="#ffffff" face="monospace">syntax:
								NDB_NewtonSetWorldSize</font></td>
					</tr>
					<tr>
						<td bgcolor="#fafafa"><font face="monospace">
								<table border="0" width="95%">
									<tbody>
										<tr>
											<td width="5%"></td>
											<td width="15%">(vector 1)</td>
											<td>min point of the world</td>
										</tr>
										<tr>
											<td width="5%"></td>
											<td width="15%">(vector 2)</td>
											<td>max point of the world</td>
										</tr>
									</tbody></table>
							</font>
						</td>
					</tr>
					<tr>
						<td bgcolor="#dadada"><font face="monospace">returns: nothing</font></td>
					</tr>
					<tr>
						<td bgcolor="#fafafa"><b>Comments:</b> The Newton World is of a fixed size. You can
							set the size of the world with this function. The default is {-100, -100, -100}
							to {100, 100, 100}. This function uses the values set in <b>temp vector 1</b> for
							the min point, and <b>temp vector 2</b> for the max point.<p>
							<b>PLEASE NOTE:</b> It is very important to set the World Size or various functions
							   in Newton may not work accurately or predictably.</p></td>
					</tr>
					<tr>
						<td bgcolor="#fafafa">
							<font face="monospace"><b>NDB_SetVector 1, -150.0, -50.0, -150.0</b></font> set
							temp vector 1.<br>
							<font face="monospace"><b>NDB_SetVector 2, 150.0, 50.0, 150.0</b></font> set
							temp vector 2.<br>
							<font face="monospace"><b>NDB_NewtonSetWorldSize</b> set the world size based on
								the above points. </font>
						</td>
					</tr>
				</tbody></table>
		<p>
			<a name="NDB_NewtonSetBodyLeaveWorldEvent"></a>
			<table cellspacing="0" bordercolorlight="#0506a5" bordercolordark="#0506a5" bgcolor="#ffffff"
				border="1" width="85%">
				<tbody>
					<tr>
						<td bgcolor="#232323"><h3><font color="#fafafa">NDB_NewtonSetBodyLeaveWorldEvent</font></h3>
						</td>
					</tr>
					<tr>
						<td bgcolor="#747ff6"><font color="#ffffff" face="monospace">syntax:
								NDB_NewtonSetBodyLeaveWorldEvent flag</font></td>
					</tr>
					<tr>
						<td bgcolor="#fafafa"><font face="monospace">
								<table border="0" width="95%">
									<tbody>
										<tr>
											<td width="5%"></td>
											<td width="15%">flag</td>
											<td>1 = destroy body</td>
										</tr>
									</tbody></table>
							</font>
						</td>
					</tr>
					<tr>
						<td bgcolor="#dadada"><font face="monospace">returns: nothing</font></td>
					</tr>
					<tr>
						<td bgcolor="#fafafa"><b>Comments:</b> Sets how to handle any body that has left
							the bounds of the Newton world. a flag of "1" means to destroy the body. And
							other number will simply ignore the object.
						</td>
					</tr>
				</tbody></table>
		<p>
			<a name="NDB_NewtonWorldFreezeBody"></a>
			<table cellspacing="0" bordercolorlight="#0506a5" bordercolordark="#0506a5" bgcolor="#ffffff"
				border="1" width="85%">
				<tbody>
					<tr>
						<td bgcolor="#232323"><h3><font color="#fafafa">NDB_NewtonWorldFreezeBody</font></h3>
						</td>
					</tr>
					<tr>
						<td bgcolor="#747ff6"><font color="#ffffff" face="monospace">syntax:
								NDB_NewtonWorldFreezeBody body</font></td>
					</tr>
					<tr>
						<td bgcolor="#fafafa"><font face="monospace">
								<table border="0" width="95%">
									<tbody>
										<tr>
											<td width="5%"></td>
											<td width="15%">body</td>
											<td>index of the rigid body (integer)</td>
										</tr>
									</tbody></table>
							</font>
						</td>
					</tr>
					<tr>
						<td bgcolor="#dadada"><font face="monospace">returns: nothing</font></td>
					</tr>
					<tr>
						<td bgcolor="#fafafa"><b>Comments:</b> Removes the rigid body from the active list,
							effectively "freezing" it in space.</td>
					</tr>
				</tbody></table>
		<p>
			<a name="NDB_NewtonWorldUnfreezeBody"></a>
			<table cellspacing="0" bordercolorlight="#0506a5" bordercolordark="#0506a5" bgcolor="#ffffff"
				border="1" width="85%">
				<tbody>
					<tr>
						<td bgcolor="#232323"><h3><font color="#fafafa">NDB_NewtonWorldUnfreezeBody</font></h3>
						</td>
					</tr>
					<tr>
						<td bgcolor="#747ff6"><font color="#ffffff" face="monospace">syntax:
								NDB_NewtonWorldUnfreezeBody body</font></td>
					</tr>
					<tr>
						<td bgcolor="#fafafa"><font face="monospace">
								<table border="0" width="95%">
									<tbody>
										<tr>
											<td width="5%"></td>
											<td width="15%">body</td>
											<td>index of the rigid body (integer)</td>
										</tr>
									</tbody></table>
							</font>
						</td>
					</tr>
					<tr>
						<td bgcolor="#dadada"><font face="monospace">returns: nothing</font></td>
					</tr>
					<tr>
						<td bgcolor="#fafafa"><b>Comments:</b> Puts the rigid body back into the active
							list, "unfreezing" it.</td>
					</tr>
				</tbody></table>
		<p><a name="NDB_NewtonWorldRayCast"></a></p>
		<table cellspacing="0" bordercolorlight="#0506a5" bordercolordark="#0506a5" bgcolor="#ffffff"
			border="1" width="85%">
			<tr>
				<td bgcolor="#232323">
					<h3><font color="#fafafa">NDB_NewtonWorldRayCast</font></h3>
				</td>
			</tr>
			<tr>
				<td bgcolor="#747ff6"><font color="#ffffff" face="monospace">syntax: dist =
						NDB_NewtonWorldRayCast( [flag] )</font></td>
			</tr>
			<tr>
				<td bgcolor="#fafafa"><font face="monospace">
						<table border="0" width="95%">
							<tbody>
								<tr>
									<td width="5%"></td>
									<td width="15%">flag</td>
									<td>flag for type of ray cast to use. 1=closest massed body, 2=closest massless
										body (integer) *optional</td>
								</tr>
							</tbody>
							<tr>
								<td width="5%">&nbsp;</td>
								<td width="15%">(vector 1)</td>
								<td>temp vector used for passing values</td>
							</tr>
							<tr>
								<td width="5%">&nbsp;</td>
								<td width="15%">(vector 2)</td>
								<td>temp vector used for passing values</td>
							</tr>
						</table>
					</font>
				</td>
			</tr>
			<tr>
				<td bgcolor="#dadada"><font face="monospace">returns: distance to the found body
						(float).</font></td>
			</tr>
			<tr>
				<td bgcolor="#fafafa">
					<p><b>Comments:</b> This is a general Raycast function for the Newton rigid
						bodies... &nbsp;you might think of it as a Newton "intersect object" command.
						&nbsp;Before calling this command, you must fill the temp vectors 1 and 2 with
						the start and end points of the ray you wish to check. &nbsp;the returned value
						is an interpolation along this line. &nbsp;for example, if the collision
						occurred half way down the line, the function will return a value of 0.5.
						&nbsp;if no collision is returned, a value greater than 1.0 is returned.</p>
					<p>This command accepts a few different flags to adjust how the raycast works.
						&nbsp;called with no flag, the command will find the closest body, regardless
						of what kind of rigid body it is.</p>
					<p>Calling with a flag of ",1" specifies for the system to only look for rigid
						bodies with a mass value &gt; 0.</p>
					<p>calling with a flag of ",2" specifies for the system to only look for rigid
						bodies with a mass EQUAL to 0.</p>
					<p>Although the distance interpolation is returned, this function also returns some
						other information, including the rigid body found, and the normal of the
						collision. &nbsp;you can get this data with the <a href="#NDB_RayCastGetBody">NDB_RayCastGetBody</a>
						and <a href="#NDB_RayCastGetNormal">NDB_RayCastGetNormal</a> commands.</p>
				</td>
			</tr>
		</table>
		<p><a name="NDB_NewtonWorldRayCastAllBodies"></a></p>
		<table cellspacing="0" bordercolorlight="#0506a5" bordercolordark="#0506a5" bgcolor="#ffffff"
			border="1" width="85%">
			<tr>
				<td bgcolor="#232323">
					<h3><font color="#fafafa">NDB_NewtonWorldRayCastAllBodies</font></h3>
				</td>
			</tr>
			<tr>
				<td bgcolor="#747ff6"><font color="#ffffff" face="monospace">syntax: int =
						NDB_NewtonWorldRayCastAllBodies()</font></td>
			</tr>
			<tr>
				<td bgcolor="#fafafa"><font face="monospace">
						<table border="0" width="95%">
							<tbody></tbody>
							<tr>
								<td width="5%">&nbsp;</td>
								<td width="15%">(vector 1)</td>
								<td>temp vector used for passing values</td>
							</tr>
							<tr>
								<td width="5%">&nbsp;</td>
								<td width="15%">(vector 2)</td>
								<td>temp vector used for passing values</td>
							</tr>
						</table>
					</font>
				</td>
			</tr>
			<tr>
				<td bgcolor="#dadada"><font face="monospace">returns: number of bodies hit by the ray
						(integer)</font></td>
			</tr>
			<tr>
				<td bgcolor="#fafafa">
					<p><b>Comments:</b> This is a general Raycast function for the Newton rigid
						bodies... &nbsp;you might think of it as a Newton "intersect object" command.
						&nbsp;Before calling this command, you must fill the temp vectors 1 and 2 with
						the start and end points of the ray you wish to check.</p>
					<p>The returned value is the number of bodies hit by the ray in total. &nbsp;you
						can then call the <a href="#NDB_RayCastGetBody">NDB_RayCastGetBody</a>, <a href="#NDB_RayCastGetDist">
							NDB_RayCastGetDist</a>, and <a href="#NDB_RayCastGetNormal">NDB_RayCastGetNormal</a>
						commands for each of these bodies to gather information abour every body hit by
						the ray.</p>
				</td>
			</tr>
		</table>
		<p><a name="NDB_RayCastGetBody"></a></p>
		<table cellspacing="0" bordercolorlight="#0506a5" bordercolordark="#0506a5" bgcolor="#ffffff"
			border="1" width="85%">
			<tr>
				<td bgcolor="#232323">
					<h3><font color="#fafafa">NDB_RayCastGetBody</font></h3>
				</td>
			</tr>
			<tr>
				<td bgcolor="#747ff6"><font color="#ffffff" face="monospace">syntax: int =
						NDB_RayCastGetBody( [index] )</font></td>
			</tr>
			<tr>
				<td bgcolor="#fafafa"><font face="monospace">
						<table border="0" width="95%">
							<tbody></tbody>
							<tr>
								<td width="5%">&nbsp;</td>
								<td width="15%">index</td>
								<td>index for what ray cast data to retrieve *optional</td>
							</tr>
						</table>
					</font>
				</td>
			</tr>
			<tr>
				<td bgcolor="#dadada"><font face="monospace">returns: ID of rigid body hit by the ray
						(integer)</font></td>
			</tr>
			<tr>
				<td bgcolor="#fafafa">
					<p><b>Comments:</b> This command returns the rigid body hit by the ray. &nbsp;If
						you have called <a href="#NDB_NewtonWorldRayCast">NDB_NewtonWorldRayCast</a> before
						this, call this command with no index value, or a value of "1", as only 1 body
						is found. &nbsp;If you used the <a href="#NDB_NewtonWorldRayCastAllBodies">NDB_NewtonWorldRayCastAllBodies</a>
						command, you can pass any value between 1 and the number of bodies found.</p>
				</td>
			</tr>
		</table>
		<p><a name="NDB_RayCastGetDist"></a></p>
		<table cellspacing="0" bordercolorlight="#0506a5" bordercolordark="#0506a5" bgcolor="#ffffff"
			border="1" width="85%">
			<tr>
				<td bgcolor="#232323">
					<h3><font color="#fafafa">NDB_RayCastGetDist</font></h3>
				</td>
			</tr>
			<tr>
				<td bgcolor="#747ff6"><font color="#ffffff" face="monospace">syntax: float&nbsp;=
						NDB_RayCastGetDist( [index] )</font></td>
			</tr>
			<tr>
				<td bgcolor="#fafafa"><font face="monospace">
						<table border="0" width="95%">
							<tbody></tbody>
							<tr>
								<td width="5%">&nbsp;</td>
								<td width="15%">index</td>
								<td>index for what ray cast data to retrieve *optional</td>
							</tr>
						</table>
					</font>
				</td>
			</tr>
			<tr>
				<td bgcolor="#dadada"><font face="monospace">returns: distance to the body hit by the
						ray (float)</font></td>
			</tr>
			<tr>
				<td bgcolor="#fafafa">
					<p><b>Comments:</b> This command returns the
						distance&nbsp;(value&nbsp;between&nbsp;0.0&nbsp;and&nbsp;1.0)&nbsp;to&nbsp;the
						rigid body hit by the ray.
					</p>
					<p>&nbsp;If you have called <a href="#NDB_NewtonWorldRayCast">NDB_NewtonWorldRayCast</a>
						before this, call this command with no index value, or a value of "1", as only
						1 body is found. &nbsp;If you used the <a href="#NDB_NewtonWorldRayCastAllBodies">NDB_NewtonWorldRayCastAllBodies</a>
						command, you can pass any value between 1 and the number of bodies found.</p>
				</td>
			</tr>
		</table>
		<p><a name="NDB_RayCastGetNormal"></a></p>
		<table cellspacing="0" bordercolorlight="#0506a5" bordercolordark="#0506a5" bgcolor="#ffffff"
			border="1" width="85%">
			<tr>
				<td bgcolor="#232323">
					<h3><font color="#fafafa">NDB_RayCastGetNormal</font></h3>
				</td>
			</tr>
			<tr>
				<td bgcolor="#747ff6"><font color="#ffffff" face="monospace">syntax:
						NDB_RayCastGetNormal [index] </font>
				</td>
			</tr>
			<tr>
				<td bgcolor="#fafafa"><font face="monospace">
						<table border="0" width="95%">
							<tbody></tbody>
							<tr>
								<td width="5%">&nbsp;</td>
								<td width="15%">index</td>
								<td>index for what ray cast data to retrieve *optional</td>
							</tr>
							<tr>
								<td width="5%">&nbsp;</td>
								<td width="15%">(vector 1)</td>
								<td>temp vector used for returning values.</td>
							</tr>
						</table>
					</font>
				</td>
			</tr>
			<tr>
				<td bgcolor="#dadada"><font face="monospace">returns: nothing.</font></td>
			</tr>
			<tr>
				<td bgcolor="#fafafa">
					<p><b>Comments:</b> This command returns the normal body at the ray collision
						point. &nbsp;It fills the internal <b>temp vector 1</b> with the normal.</p>
					<p>&nbsp;If you have called <a href="#NDB_NewtonWorldRayCast">NDB_NewtonWorldRayCast</a>
						before this, call this command with no index value, or a value of "1", as only
						1 body is found. &nbsp;If you used the <a href="#NDB_NewtonWorldRayCastAllBodies">NDB_NewtonWorldRayCastAllBodies</a>
						command, you can pass any value between 1 and the number of bodies found.</p>
				</td>
			</tr>
		</table>
		<p>
			<a name="NDB_NewtonDestroyJoint"></a>
			<table cellspacing="0" bordercolorlight="#0506a5" bordercolordark="#0506a5" bgcolor="#ffffff"
				border="1" width="85%">
				<tbody>
					<tr>
						<td bgcolor="#232323"><h3><font color="#fafafa">NDB_NewtonDestroyJoint</font></h3>
						</td>
					</tr>
					<tr>
						<td bgcolor="#747ff6"><font color="#ffffff" face="monospace">syntax:
								NDB_NewtonDestroyJoint joint_id</font></td>
					</tr>
					<tr>
						<td bgcolor="#fafafa"><font face="monospace">
								<table border="0" width="95%">
									<tbody>
										<tr>
											<td width="5%"></td>
											<td width="15%">joint_id</td>
											<td>
												index of the joint to destroy (integer)</td>
										</tr>
									</tbody></table>
							</font>
						</td>
					</tr>
					<tr>
						<td bgcolor="#dadada"><font face="monospace">returns: nothing</font></td>
					</tr>
					<tr>
						<td bgcolor="#fafafa"><b>Comments:</b> Destroys a joint from the world. the <b>joint_id</b>
							value is the value returned by the function that created the joint (<a href="#NDB_NewtonConstraintCreateBall">NDB_NewtonConstraintCreateBall</a>,
							<a href="#NDB_NewtonConstraintCreateHinge">NDB_NewtonConstraintCreateHinge</a>, <a href="#NDB_NewtonConstraintCreateSlider">
								NDB_NewtonConstraintCreateSlider</a>)</td>
					</tr>
				</tbody></table>
				<p>
			<a name="NDB_NewtonCollisionCollide"></a>
			<table cellspacing="0" bordercolorlight="#0506a5" bordercolordark="#0506a5" bgcolor="#ffffff"
				border="1" width="85%">
				<tbody>
					<tr>
						<td bgcolor="#232323"><h3><font color="#fafafa">NDB_NewtonCollisionCollide</font></h3>
						</td>
					</tr>
					<tr>
						<td bgcolor="#747ff6"><font color="#ffffff" face="monospace">syntax: count =
								NDB_NewtonCollisionCollide( col1, col2 )</font></td>
					</tr>
					<tr>
						<td bgcolor="#fafafa"><font face="monospace">
								<table border="0" width="95%">
									<tbody>
										<tr>
											<td width="5%"></td>
											<td width="15%">col1</td>
											<td>index of collision1 (integer)</td>
										</tr>
										<tbody>
											<tr>
												<td width="5%"></td>
												<td width="15%">col2</td>
												<td>index of collision2 (integer)</td>
											</tr>
											<tbody>
												<tr>
													<td width="5%"></td>
													<td width="15%">(temp vector 1)</td>
													<td>temp vector used to pass values.</td>
												</tr>
												<tbody>
													<tr>
														<td width="5%"></td>
														<td width="15%">(temp vector 2)</td>
														<td>temp vector used to pass values.</td>
													</tr>
													<tbody>
														<tr>
															<td width="5%"></td>
															<td width="15%">(temp vector 3)</td>
															<td>temp vector used to pass values.</td>
														</tr>
														<tbody>
															<tr>
																<td width="5%"></td>
																<td width="15%">(temp vector 4)</td>
																<td>temp vector used to pass values.</td>
															</tr>
														</tbody></table>
							</font>
						</td>
					</tr>
					<tr>
						<td bgcolor="#dadada"><font face="monospace">returns: number of contacts found
								(integer)</font></td>
					</tr>
					<tr>
						<td bgcolor="#fafafa"><b>Comments:</b> This is a way to access Newton's impressive
							collision detection system <b>without</b> the physics. You can use this for
							your own general collision tests, such as zone testing, etc. You call this
							function by passing the indices to 2 collision geometries, made from the
							NDB_NewtonCreate... commands (<a href="ndb_docs_convex.htm#NDB_NewtonCreateBox">NDB_NewtonCreateBox</a>
							for example). then, you fill the tmp vectors like so:<br>
							<br>
							<b>temp vector 1</b> - position of col1<br>
							<b>temp vector 2</b> - rotation of col1<br>
							<b>temp vector 3</b> - position of col2<br>
							<b>temp vector 4</b> - rotation of col2<br>
							<br>
							the function returns an integer, which is the the number of contacts found
							between the collision geometries. a return value of zero means no collision was
							found.<br>
							After calling this function, you can call the following functions with any
							number between 1 and the return value to gather more information about the
							collision detected:<br>
							<a href="#NDB_GetCollisionContact">NDB_GetCollisionContact</a><br>
							<a href="#NDB_GetCollisionNormal">NDB_GetCollisionNormal</a><br>
							<a href="#NDB_GetCollisionPenetration">NDB_GetCollisionPenetration</a><br>
						</td>
					</tr>
				</tbody></table>
		<p>
			<a name="NDB_GetCollisionContact"></a>
			<table cellspacing="0" bordercolorlight="#0506a5" bordercolordark="#0506a5" bgcolor="#ffffff"
				border="1" width="85%">
				<tbody>
					<tr>
						<td bgcolor="#232323"><h3><font color="#fafafa">NDB_GetCollisionContact</font></h3>
						</td>
					</tr>
					<tr>
						<td bgcolor="#747ff6"><font color="#ffffff" face="monospace">syntax:
								NDB_GetCollisionContact index</font></td>
					</tr>
					<tr>
						<td bgcolor="#fafafa"><font face="monospace">
								<table border="0" width="95%">
									<tbody>
										<tr>
											<td width="5%"></td>
											<td width="15%">index</td>
											<td>index to collision data (integer)</td>
										</tr>
										<tbody>
											<tr>
												<td width="5%"></td>
												<td width="15%">(temp vector 1)</td>
												<td>temp vector used to return values.</td>
											</tr>
										</tbody></table>
							</font>
						</td>
					</tr>
					<tr>
						<td bgcolor="#dadada"><font face="monospace">returns: nothing</font></td>
					</tr>
					<tr>
						<td bgcolor="#fafafa"><b>Comments:</b> This function fills <b>temp vector 1</b> with
							the contact point found by the <a href="#NDB_NewtonCollisionCollide">NDB_NewtonCollisionCollide</a>
							command. You must pass a value between 1 and the return value of that command
							to get meaningful data.</td>
					</tr>
				</tbody></table>
		<p>
			<a name="NDB_GetCollisionNormal"></a>
			<table cellspacing="0" bordercolorlight="#0506a5" bordercolordark="#0506a5" bgcolor="#ffffff"
				border="1" width="85%">
				<tbody>
					<tr>
						<td bgcolor="#232323"><h3><font color="#fafafa">NDB_GetCollisionNormal</font></h3>
						</td>
					</tr>
					<tr>
						<td bgcolor="#747ff6"><font color="#ffffff" face="monospace">syntax:
								NDB_GetCollisionNormal index</font></td>
					</tr>
					<tr>
						<td bgcolor="#fafafa"><font face="monospace">
								<table border="0" width="95%">
									<tbody>
										<tr>
											<td width="5%"></td>
											<td width="15%">index</td>
											<td>index to collision data (integer)</td>
										</tr>
										<tbody>
											<tr>
												<td width="5%"></td>
												<td width="15%">(temp vector 1)</td>
												<td>temp vector used to return values.</td>
											</tr>
										</tbody></table>
							</font>
						</td>
					</tr>
					<tr>
						<td bgcolor="#dadada"><font face="monospace">returns: nothing</font></td>
					</tr>
					<tr>
						<td bgcolor="#fafafa"><b>Comments:</b> This function fills <b>temp vector 1</b> with
							the contact normal found by the <a href="#NDB_NewtonCollisionCollide">NDB_NewtonCollisionCollide</a>
							command. You must pass a value between 1 and the return value of that command
							to get meaningful data.</td>
					</tr>
				</tbody></table>
		<p>
			<a name="NDB_GetCollisionPenetration"></a>
			<table cellspacing="0" bordercolorlight="#0506a5" bordercolordark="#0506a5" bgcolor="#ffffff"
				border="1" width="85%">
				<tbody>
					<tr>
						<td bgcolor="#232323"><h3><font color="#fafafa">NDB_GetCollisionPenetration</font></h3>
						</td>
					</tr>
					<tr>
						<td bgcolor="#747ff6"><font color="#ffffff" face="monospace">syntax: float =
								NDB_GetCollisionPenetration( index )</font></td>
					</tr>
					<tr>
						<td bgcolor="#fafafa"><font face="monospace">
								<table border="0" width="95%">
									<tbody>
										<tr>
											<td width="5%"></td>
											<td width="15%">index</td>
											<td>index to collision data (integer)</td>
										</tr>
									</tbody></table>
							</font>
						</td>
					</tr>
					<tr>
						<td bgcolor="#dadada"><font face="monospace">returns: penetration distance (float)</font></td>
					</tr>
					<tr>
						<td bgcolor="#fafafa"><b>Comments:</b> This function returns the penetration
							distance found by the <a href="#NDB_NewtonCollisionCollide">NDB_NewtonCollisionCollide</a>
							command. You must pass a value between 1 and the return value of that command
							to get meaningful data.</td>
					</tr>
				</tbody></table>
		<p>
		<p>
		</p>
	</body>
</html>
